<!DOCTYPE html>
<html lang="es">
    <head>
        <meta charset="utf-8">
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
        <?php
        $baseUrl = Yii::app()->theme->baseUrl;
        $cs = Yii::app()->getClientScript();
        Yii::app()->clientScript->registerCoreScript('jquery');
        ?>
        <script>
            var baseUrl = "<?php print Yii::app()->baseUrl . '/'; ?>";
            var themeUrl = "<?php print Yii::app()->theme->baseUrl . '/'; ?>";
            var user_id = "<?php print Yii::app()->user->id; ?>";
            var DEMO_ADMINFLARE_VERSION = '1.3.0';
            var DEMO_CURRENT_THEME = 'orange';
        </script>
       	<script type="text/javascript">
            document.write('<link href="' + themeUrl + 'css/' + DEMO_ADMINFLARE_VERSION + '/' + DEMO_CURRENT_THEME + '/bootstrap.css" media="all" rel="stylesheet" type="text/css" id="bootstrap-css">');
            document.write('<link href="' + themeUrl + 'css/' + DEMO_ADMINFLARE_VERSION + '/' + DEMO_CURRENT_THEME + '/adminflare.css" media="all" rel="stylesheet" type="text/css" id="adminflare-css">');
        </script>

        <?php
        $cs->registerScriptFile($baseUrl . '/javascripts/1.3.0/common.js');
        $cs->registerScriptFile($baseUrl . '/javascripts/1.3.0/jquery.nicescroll.min.js');
        $cs->registerScriptFile($baseUrl . '/javascripts/mega_menu/script.js');
        $cs->registerScriptFile($baseUrl . '/javascripts/plugin/wizard.js');
        $cs->registerCssFile($baseUrl . '/css/1.3.0/orange/common.css');
        $cs->registerCssFile($baseUrl . '/css/mega_menu/style.css');
        $cs->registerCssFile($baseUrl . '/css/mega_menu/MyMedia.css');
        $cs->registerCssFile($baseUrl . '/css/mega_menu/bootstrap-tabs.css');
        $cs->registerCssFile($baseUrl . '/css/plugin/wizard.less');
        ?>

        <script>//
//            $(function() {
//                /* Wizard
//                 ================================================== */
//                $('#myWizard').on('change', function(e, data) {
//                    console.log('change');
//                    if (data.step === 3 && data.direction === 'next') {
//                        // return e.preventDefault();
//                    }
//                });
//
//                $('#myWizard').on('changed', function(e, data) {
//                    console.log('changed');
//                });
//
//                $('#myWizard').on('finished', function(e, data) {
//                    console.log('finished');
//                });
//
//                $('#wizard-prev').on('click', function() {
//                    $('#myWizard').wizard('previous');
//                });
//
//                $('#wizard-next').on('click', function() {
//                    $('#myWizard').wizard('next', 'foo');
//                });
//
//                $('#wizard-logItem').on('click', function() {
//                    var item = $('#myWizard').wizard('selectedItem');
//                    console.log(item.step);
//                });
//            });
//        </script>
    </head>
    <body >
        <!-- HEADER -->
        <?php require_once('tpl_navigation.php') ?>
        <!-- /#navigation-main -->
    <main class="main-body" >
        <div class="">
            <!-- Include content pages -->
            <div class="row-fluid">
                <div id="maiMessages" class="flash-messages">
                    <?php
                    $flashMessages = Yii::app()->user->getFlashes();
                    if ($flashMessages) {
                        echo '<ul class="flashes">';
                        foreach ($flashMessages as $key => $message) {
                            echo '<li><div class="flash-' . $key . '">' . $message . "</div></li>\n";
                        }
                        echo '</ul>';
                    }
                    ?>
                </div>
            </div>
            <div class="row-fluid">
                <?php if (Yii::app()->user->checkAccess("admin")): ?>
                    <div class="span1" >
                        <nav id="left-panel" style="height: 100%; ">
                            <div id="left-panel-content" >
                                <?php
                                $this->widget('zii.widgets.CMenu', array(
                                    'items' => Yii::app()->user->checkAccess("admin") ? Menu::getAdminMenu($this) : Menu::getMenu($this),
                                    'encodeLabel' => false,
                                    'itemCssClass' => 'flare-sub-menu',
                                    'activeCssClass' => 'active',
//                            'htmlOptions' => array('style' => '-webkit-transition: -webkit-transform 0ms; transition: -webkit-transform 0ms; -webkit-transform-origin: 0px 0px; -webkit-transform: translate3d(0px, 0px, 0px);'),
                                    'submenuHtmlOptions' => array('class' => 'flare-sub')
                                ));
//                        
                                ?>
                            </div>
                        </nav>
                    </div>

                    <br>
                    <div class="span10">
                        <?php
                        echo $content;
                        ?>
                    </div>
                <?php else: ?>
                    <div>
                        <?php
                        echo $content;
                        ?>
                    </div>
                <?php endif; ?>
            </div>

        </div>
    </main>
    <!-- Require the footer -->
    <?php require_once('tpl_footer.php') ?>
</body>
</html>